

$(function() {

    var dynamicContainer = $('#dynamic-shuffle-container');
    dynamicContainer.shuffle({
        sizer: 'col-md-4',
        speed: 400,
        easing: 'ease-out'
    });

    $('.dynamic-btn-shuffle').on('click', function() {
        var category = $(this).data('category');
        dynamicContainer.shuffle('shuffle', function(elem, shuffle) {
            if (category === 'all') {
                return true;
            } else {
                return (elem.data('groups').indexOf(category) > -1);
            }
        });
    });

    var staticContainer = $('#static-shuffle-container');
    staticContainer.shuffle({
        sizer: 'col-md-4',
        speed: 400,
        easing: 'ease-out'
    });

    $('.static-btn-shuffle').on('click', function() {
        var category = $(this).data('category');
        staticContainer.shuffle('shuffle', function(elem, shuffle) {
            if (category === 'all') {
                return true;
            } else {
                return (elem.data('groups').indexOf(category) > -1);
            }
        });
    });


});